<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
    <link rel="stylesheet" href="./style.css">
    <title>Document</title>
</head>

<body class="h-full">

    <div class="w-1/3 bg-green-400 m-8 p-4 space-x-2 inline-flex">
        <canvas width="300" height="300" class="bg-white inline-block" id="canvas-1"></canvas>
        <div class="w-full2 text-sm">
            <div class="w-full block float-right">测试 </div>
        </div>
        <script>
            var canvas = document.getElementById("canvas-1");
            if (canvas.getContext) {
                var ctx = canvas.getContext('2d');

                ctx.fillRect(25, 25, 100, 100);
                ctx.clearRect(45, 45, 60, 60);
                ctx.strokeRect(50, 50, 50, 50);
            }
        </script>
    </div>

</body>

</html>